package bb.lanxing.model.jsonlocal;

import bb.lanxing.model.database.PacePoint;
import bb.lanxing.util.CommonUtil;

public class JSegmentKm {
    private double altitude;
    private double distance;
    private long duration;
    private int paceIndex;
    private double latitude;
    private double longitude;
    private double maxSpeed;
    private int sport;
    private long timestamp;
    private int type;

    private String workoutUuid;

    public static JSegmentKm create(PacePoint pacePoint) {
        JSegmentKm jSegmentKm = new JSegmentKm();
        jSegmentKm.setPaceIndex(pacePoint.getIndex());
        jSegmentKm.setSport(pacePoint.getSport());
        jSegmentKm.setType(pacePoint.getType());
        jSegmentKm.setWorkoutUuid(pacePoint.getWorkoutUuid());
//        jSegmentKm.setLatitude(CommonUtil.roundDouble(pacePoint.getLatitude(), 6));
//        jSegmentKm.setLongitude(CommonUtil.roundDouble(pacePoint.getLongitude(), 6));
//        jSegmentKm.setAltitude(CommonUtil.roundDouble(pacePoint.getAltitude(), 2));
        jSegmentKm.setLatitude(pacePoint.getLatitude());
        jSegmentKm.setLongitude(pacePoint.getLongitude());
        jSegmentKm.setAltitude(pacePoint.getAltitude());


        jSegmentKm.setTimestamp(pacePoint.getTimestamp());
//        jSegmentKm.setDistance(CommonUtil.roundDouble(pacePoint.getDistance(), 2));
        jSegmentKm.setDistance(pacePoint.getDistance());
        jSegmentKm.setDuration(pacePoint.getDuration());
        jSegmentKm.setMaxSpeed(CommonUtil.roundDouble(pacePoint.getMaxSpeed(), 2));
        jSegmentKm.setMaxSpeed(pacePoint.getMaxSpeed());

        return jSegmentKm;
    }

    public int getPaceIndex() {
        return this.paceIndex;
    }

    public void setPaceIndex(int i) {
        this.paceIndex = i;
    }

    public void setWorkoutUuid(String workoutUuid) {
        this.workoutUuid = workoutUuid;
    }

    public String getWorkoutUuid() {
        return workoutUuid;
    }

    public int getSport() {
        return this.sport;
    }

    public void setSport(int i) {
        this.sport = i;
    }

    public int getType() {
        return this.type;
    }

    public void setType(int i) {
        this.type = i;
    }

    public double getLatitude() {
        return this.latitude;
    }

    public void setLatitude(double d) {
        this.latitude = d;
    }

    public double getLongitude() {
        return this.longitude;
    }

    public void setLongitude(double d) {
        this.longitude = d;
    }

    public double getAltitude() {
        return this.altitude;
    }

    public void setAltitude(double d) {
        this.altitude = d;
    }

    public long getTimestamp() {
        return this.timestamp;
    }

    public void setTimestamp(long j) {
        this.timestamp = j;
    }

    public double getDistance() {
        return this.distance;
    }

    public void setDistance(double d) {
        this.distance = d;
    }

    public long getDuration() {
        return this.duration;
    }

    public void setDuration(long j) {
        this.duration = j;
    }

    public double getMaxSpeed() {
        return this.maxSpeed;
    }

    public void setMaxSpeed(double d) {
        this.maxSpeed = d;
    }
}
